// Copyright 2021 ETH Zurich and University of Bologna.
// Solderpad Hardware License, Version 0.51, see LICENSE for details.
// SPDX-License-Identifier: SHL-0.51
//
// Author: Matteo Perotti <mperotti@iis.ee.ethz.ch>
//         Basile Bougenot <bbougenot@student.ethz.ch>

#include "float_macros.h"
#include "vector_macros.h"

// Simple random test with similar values + 1 subnormal
void TEST_CASE1(void) {
  VSET(16, e16, m1);
  //               0.9390,  0.9619,  0.9121,  0.6265,  0.1193, -0.4492, -0.3562,
  //               0.2365, -0.9897,  0.8638, -0.0379, -0.6201,  0.1809,  0.9824,
  //               -0.9922, -0.6851
  VLOAD_16(v2, 0x3b83, 0x3bb2, 0x3b4c, 0x3903, 0x2fa2, 0xb730, 0xb5b3, 0x3391,
           0xbbeb, 0x3ae9, 0xa8da, 0xb8f6, 0x31ca, 0x3bdc, 0xbbf0, 0xb97b);
  //               0.9795, -0.1069,  0.7070, -0.7305,  0.0516, -0.1321,  0.3828,
  //               0.0230, -0.9424, -0.8652, -0.3865, -0.1719, -0.7021,  0.1664,
  //               0.7026, -0.8535
  VLOAD_16(v3, 0x3bd6, 0xaed8, 0x39a8, 0xb9d8, 0x2a9a, 0xb03a, 0x3620, 0x25e2,
           0xbb8a, 0xbaec, 0xb62f, 0xb180, 0xb99e, 0x3153, 0x399f, 0xbad4);
  asm volatile("vfmin.vv v1, v2, v3");
  //               0.9390, -0.1069,  0.7070, -0.7305,  0.0516, -0.4492, -0.3562,
  //               0.0230, -0.9897, -0.8652, -0.3865, -0.6201, -0.7021,  0.1664,
  //               -0.9922, -0.8535
  VCMP_U16(1, v1, 0x3b83, 0xaed8, 0x39a8, 0xb9d8, 0x2a9a, 0xb730, 0xb5b3,
           0x25e2, 0xbbeb, 0xbaec, 0xb62f, 0xb8f6, 0xb99e, 0x3153, 0xbbf0,
           0xbad4);

  VSET(16, e32, m1);
  //               0.33477312, -0.14129849, -0.94871885,  0.83600986,
  //               -0.28163233, -0.47814348,  0.77408481, -0.54823470,
  //               -0.72419900,  0.27495387, -0.76835793,  0.71516198,
  //               0.32305571, -0.76598656, -0.36499983, -0.52954155
  VLOAD_32(v2, 0x3eab6762, 0xbe10b08d, 0xbf72df3d, 0x3f5604be, 0xbe90321d,
           0xbef4cf39, 0x3f462a6c, 0xbf0c591c, 0xbf39651b, 0x3e8cc6c1,
           0xbf44b31b, 0x3f3714db, 0x3ea5678f, 0xbf4417b2, 0xbebae142,
           0xbf079009);
  //               0.87184614,  0.40005061,  0.40118238,  0.97373396,
  //               0.74085194, -0.99458516, -0.73125440, -0.46319291,
  //               -0.76140571, -0.82557100,  0.15205561,  0.39971715,
  //               -0.32876521, -0.53106725,  0.84727478,  0.21940185
  VLOAD_32(v3, 0x3f5f314f, 0x3eccd36f, 0x3ecd67c7, 0x3f7946a1, 0x3f3da879,
           0xbf7e9d22, 0xbf3b337d, 0xbeed279f, 0xbf42eb7c, 0xbf53589f,
           0x3e1bb477, 0x3ecca7ba, 0xbea853ea, 0xbf07f406, 0x3f58e700,
           0x3e60aae1);
  asm volatile("vfmin.vv v1, v2, v3");
  //               0.33477312, -0.14129849, -0.94871885,  0.83600986,
  //               -0.28163233, -0.99458516, -0.73125440, -0.54823470,
  //               -0.76140571, -0.82557100, -0.76835793,  0.39971715,
  //               -0.32876521, -0.76598656, -0.36499983, -0.52954155
  VCMP_U32(2, v1, 0x3eab6762, 0xbe10b08d, 0xbf72df3d, 0x3f5604be, 0xbe90321d,
           0xbf7e9d22, 0xbf3b337d, 0xbf0c591c, 0xbf42eb7c, 0xbf53589f,
           0xbf44b31b, 0x3ecca7ba, 0xbea853ea, 0xbf4417b2, 0xbebae142,
           0xbf079009);

  VSET(16, e64, m1);
  //               0.9387726994461698,  0.8517969615002949, -0.8864275043807637,
  //               0.3621349692771021,  0.5392486258321831, -0.1288714247798126,
  //               -0.9149173505741688, -0.9378576380992047,
  //               -0.2263428385339852,  0.1016628884386184, 0.4783549203499486,
  //               0.5394596797016060,  0.7861587828590215,  0.0194772848204161,
  //               -0.9126826319328591,  0.3997583898469530
  VLOAD_64(v2, 0x3fee0a6d0b4ff74a, 0x3feb41ebb38f3ae2, 0xbfec5d9d36b2e38c,
           0x3fd72d3826721e9c, 0x3fe14186558b96e0, 0xbfc07edbdd68bb68,
           0xbfed4700c06849e8, 0xbfee02ee057e1390, 0xbfccf8cd5897f8a0,
           0x3fba06943d0f8e20, 0x3fde9d5df4b22860, 0x3fe14340f23a8770,
           0x3fe9283676baf718, 0x3f93f1da754635c0, 0xbfed34b234f8ec38,
           0x3fd995a436ac6f1c);
  //               0.4808082103120717,  0.7218925128932789, -0.9454618185734458,
  //               0.7335258472548418,  0.9800819535502201, -0.6873536121819364,
  //               -0.7090903925273744,  0.7813319828098306, 0.6810234154055235,
  //               0.1176441554686278,  0.4929731878752270,  0.0942028280153233,
  //               0.9496420237972776, -0.4549651855719854, -0.9663401540020158,
  //               0.4114236885680320
  VLOAD_64(v3, 0x3fdec58fccbc12a4, 0x3fe719be53c35314, 0xbfee413924cc77e4,
           0x3fe7790b32975e1a, 0x3fef5cd4d43cbc4e, 0xbfe5fecd00a37bfa,
           0xbfe6b0de55ba0314, 0x3fe900abee2f95f8, 0x3fe5caf19e1f4324,
           0x3fbe1ded684da4d0, 0x3fdf8cdf69eea758, 0x3fb81dad31843b10,
           0x3fee6377ab63bade, 0xbfdd1e264c366a78, 0xbfeeec422fc80224,
           0x3fda54c405ccc2c0);
  asm volatile("vfmin.vv v1, v2, v3");
  //               0.4808082103120717,  0.7218925128932789, -0.9454618185734458,
  //               0.3621349692771021,  0.5392486258321831, -0.6873536121819364,
  //               -0.9149173505741688, -0.9378576380992047,
  //               -0.2263428385339852,  0.1016628884386184, 0.4783549203499486,
  //               0.0942028280153233,  0.7861587828590215, -0.4549651855719854,
  //               -0.9663401540020158,  0.3997583898469530
  VCMP_U64(3, v1, 0x3fdec58fccbc12a4, 0x3fe719be53c35314, 0xbfee413924cc77e4,
           0x3fd72d3826721e9c, 0x3fe14186558b96e0, 0xbfe5fecd00a37bfa,
           0xbfed4700c06849e8, 0xbfee02ee057e1390, 0xbfccf8cd5897f8a0,
           0x3fba06943d0f8e20, 0x3fde9d5df4b22860, 0x3fb81dad31843b10,
           0x3fe9283676baf718, 0xbfdd1e264c366a78, 0xbfeeec422fc80224,
           0x3fd995a436ac6f1c);
};

// Simple random test with similar values + 1 subnormal (masked)
// The numbers are the same of TEST_CASE1
void TEST_CASE2(void) {
  VSET(16, e16, m1);
  //               0.9390,  0.9619,  0.9121,  0.6265,  0.1193, -0.4492, -0.3562,
  //               0.2365, -0.9897,  0.8638, -0.0379, -0.6201,  0.1809,  0.9824,
  //               -0.9922, -0.6851
  VLOAD_16(v2, 0x3b83, 0x3bb2, 0x3b4c, 0x3903, 0x2fa2, 0xb730, 0xb5b3, 0x3391,
           0xbbeb, 0x3ae9, 0xa8da, 0xb8f6, 0x31ca, 0x3bdc, 0xbbf0, 0xb97b);
  //               0.9795, -0.1069,  0.7070, -0.7305,  0.0516, -0.1321,  0.3828,
  //               0.0230, -0.9424, -0.8652, -0.3865, -0.1719, -0.7021,  0.1664,
  //               0.7026, -0.8535
  VLOAD_16(v3, 0x3bd6, 0xaed8, 0x39a8, 0xb9d8, 0x2a9a, 0xb03a, 0x3620, 0x25e2,
           0xbb8a, 0xbaec, 0xb62f, 0xb180, 0xb99e, 0x3153, 0x399f, 0xbad4);
  VLOAD_8(v0, 0xAA, 0xAA);
  VCLEAR(v1);
  asm volatile("vfmin.vv v1, v2, v3, v0.t");
  //               0.0000, -0.1069,  0.0000, -0.7305,  0.0000, -0.4492,  0.0000,
  //               0.0230,  0.0000, -0.8652,  0.0000, -0.6201,  0.0000,  0.1664,
  //               0.0000, -0.8535
  VCMP_U16(4, v1, 0x0, 0xaed8, 0x0, 0xb9d8, 0x0, 0xb730, 0x0, 0x25e2, 0x0,
           0xbaec, 0x0, 0xb8f6, 0x0, 0x3153, 0x0, 0xbad4);

  VSET(16, e32, m1);
  //               0.33477312, -0.14129849, -0.94871885,  0.83600986,
  //               -0.28163233, -0.47814348,  0.77408481, -0.54823470,
  //               -0.72419900,  0.27495387, -0.76835793,  0.71516198,
  //               0.32305571, -0.76598656, -0.36499983, -0.52954155
  VLOAD_32(v2, 0x3eab6762, 0xbe10b08d, 0xbf72df3d, 0x3f5604be, 0xbe90321d,
           0xbef4cf39, 0x3f462a6c, 0xbf0c591c, 0xbf39651b, 0x3e8cc6c1,
           0xbf44b31b, 0x3f3714db, 0x3ea5678f, 0xbf4417b2, 0xbebae142,
           0xbf079009);
  //               0.87184614,  0.40005061,  0.40118238,  0.97373396,
  //               0.74085194, -0.99458516, -0.73125440, -0.46319291,
  //               -0.76140571, -0.82557100,  0.15205561,  0.39971715,
  //               -0.32876521, -0.53106725,  0.84727478,  0.21940185
  VLOAD_32(v3, 0x3f5f314f, 0x3eccd36f, 0x3ecd67c7, 0x3f7946a1, 0x3f3da879,
           0xbf7e9d22, 0xbf3b337d, 0xbeed279f, 0xbf42eb7c, 0xbf53589f,
           0x3e1bb477, 0x3ecca7ba, 0xbea853ea, 0xbf07f406, 0x3f58e700,
           0x3e60aae1);
  VLOAD_8(v0, 0xAA, 0xAA);
  VCLEAR(v1);
  asm volatile("vfmin.vv v1, v2, v3, v0.t");
  //               0.00000000, -0.14129849,  0.00000000,  0.83600986,
  //               0.00000000, -0.99458516,  0.00000000, -0.54823470,
  //               0.00000000, -0.82557100,  0.00000000,  0.39971715,
  //               0.00000000, -0.76598656,  0.00000000, -0.52954155
  VCMP_U32(5, v1, 0x0, 0xbe10b08d, 0x0, 0x3f5604be, 0x0, 0xbf7e9d22, 0x0,
           0xbf0c591c, 0x0, 0xbf53589f, 0x0, 0x3ecca7ba, 0x0, 0xbf4417b2, 0x0,
           0xbf079009);

  VSET(16, e64, m1);
  //               0.9387726994461698,  0.8517969615002949, -0.8864275043807637,
  //               0.3621349692771021,  0.5392486258321831, -0.1288714247798126,
  //               -0.9149173505741688, -0.9378576380992047,
  //               -0.2263428385339852,  0.1016628884386184, 0.4783549203499486,
  //               0.5394596797016060,  0.7861587828590215,  0.0194772848204161,
  //               -0.9126826319328591,  0.3997583898469530
  VLOAD_64(v2, 0x3fee0a6d0b4ff74a, 0x3feb41ebb38f3ae2, 0xbfec5d9d36b2e38c,
           0x3fd72d3826721e9c, 0x3fe14186558b96e0, 0xbfc07edbdd68bb68,
           0xbfed4700c06849e8, 0xbfee02ee057e1390, 0xbfccf8cd5897f8a0,
           0x3fba06943d0f8e20, 0x3fde9d5df4b22860, 0x3fe14340f23a8770,
           0x3fe9283676baf718, 0x3f93f1da754635c0, 0xbfed34b234f8ec38,
           0x3fd995a436ac6f1c);
  //               0.4808082103120717,  0.7218925128932789, -0.9454618185734458,
  //               0.7335258472548418,  0.9800819535502201, -0.6873536121819364,
  //               -0.7090903925273744,  0.7813319828098306, 0.6810234154055235,
  //               0.1176441554686278,  0.4929731878752270,  0.0942028280153233,
  //               0.9496420237972776, -0.4549651855719854, -0.9663401540020158,
  //               0.4114236885680320
  VLOAD_64(v3, 0x3fdec58fccbc12a4, 0x3fe719be53c35314, 0xbfee413924cc77e4,
           0x3fe7790b32975e1a, 0x3fef5cd4d43cbc4e, 0xbfe5fecd00a37bfa,
           0xbfe6b0de55ba0314, 0x3fe900abee2f95f8, 0x3fe5caf19e1f4324,
           0x3fbe1ded684da4d0, 0x3fdf8cdf69eea758, 0x3fb81dad31843b10,
           0x3fee6377ab63bade, 0xbfdd1e264c366a78, 0xbfeeec422fc80224,
           0x3fda54c405ccc2c0);
  VLOAD_8(v0, 0xAA, 0xAA);
  VCLEAR(v1);
  asm volatile("vfmin.vv v1, v2, v3, v0.t");
  //               0.0000000000000000,  0.7218925128932789,  0.0000000000000000,
  //               0.3621349692771021,  0.0000000000000000, -0.6873536121819364,
  //               0.0000000000000000, -0.9378576380992047,  0.0000000000000000,
  //               0.1016628884386184,  0.0000000000000000,  0.0942028280153233,
  //               0.0000000000000000, -0.4549651855719854,  0.0000000000000000,
  //               0.3997583898469530
  VCMP_U64(6, v1, 0x0, 0x3fe719be53c35314, 0x0, 0x3fd72d3826721e9c, 0x0,
           0xbfe5fecd00a37bfa, 0x0, 0xbfee02ee057e1390, 0x0, 0x3fba06943d0f8e20,
           0x0, 0x3fb81dad31843b10, 0x0, 0xbfdd1e264c366a78, 0x0,
           0x3fd995a436ac6f1c);
};

// Simple random test with similar values (vector-scalar)
void TEST_CASE3(void) {
  VSET(16, e16, m1);
  double dscalar_16;
  //                              0.4434
  BOX_HALF_IN_DOUBLE(dscalar_16, 0x3718);
  //              -0.2537,  0.5449,  0.2070, -0.5752, -0.3008,  0.0165, -0.8447,
  //              0.6279,  0.6802,  0.7300,  0.7720, -0.8525,  0.5264, -0.5249,
  //              -0.9839,  0.4875
  VLOAD_16(v2, 0xb40f, 0x385c, 0x32a0, 0xb89a, 0xb4d0, 0x2437, 0xbac2, 0x3906,
           0x3971, 0x39d7, 0x3a2d, 0xbad2, 0x3836, 0xb833, 0xbbdf, 0x37cd);
  asm volatile("vfmin.vf v1, v2, %[A]" ::[A] "f"(dscalar_16));
  //              -0.2537,  0.4434,  0.2070, -0.5752, -0.3008,  0.0165, -0.8447,
  //              0.4434,  0.4434,  0.4434,  0.4434, -0.8525,  0.4434, -0.5249,
  //              -0.9839,  0.4434
  VCMP_U16(7, v1, 0xb40f, 0x3718, 0x32a0, 0xb89a, 0xb4d0, 0x2437, 0xbac2,
           0x3718, 0x3718, 0x3718, 0x3718, 0xbad2, 0x3718, 0xb833, 0xbbdf,
           0x3718);

  VSET(16, e32, m1);
  double dscalar_32;
  //                               0.59499639
  BOX_FLOAT_IN_DOUBLE(dscalar_32, 0x3f1851af);
  //              -0.94244474, -0.52559608, -0.72424960, -0.67824948,
  //              0.22003150, -0.67564118, -0.90376341,  0.16465612,
  //              -0.15494362, -0.01763406,  0.97777683, -0.91671157,
  //              0.81712914, -0.10151604,  0.03442690, -0.14597759
  VLOAD_32(v2, 0xbf71440f, 0xbf068d77, 0xbf39686c, 0xbf2da1c2, 0x3e614ff0,
           0xbf2cf6d2, 0xbf675d0a, 0x3e289b9d, 0xbe1ea98a, 0xbc90754e,
           0x3f7a4f95, 0xbf6aad9c, 0x3f512f60, 0xbdcfe7a4, 0x3d0d0338,
           0xbe157b26);
  asm volatile("vfmin.vf v1, v2, %[A]" ::[A] "f"(dscalar_32));
  //              -0.94244474, -0.52559608, -0.72424960, -0.67824948,
  //              0.22003150, -0.67564118, -0.90376341,  0.16465612,
  //              -0.15494362, -0.01763406,  0.59499639, -0.91671157,
  //              0.59499639, -0.10151604,  0.03442690, -0.14597759
  VCMP_U32(8, v1, 0xbf71440f, 0xbf068d77, 0xbf39686c, 0xbf2da1c2, 0x3e614ff0,
           0xbf2cf6d2, 0xbf675d0a, 0x3e289b9d, 0xbe1ea98a, 0xbc90754e,
           0x3f1851af, 0xbf6aad9c, 0x3f1851af, 0xbdcfe7a4, 0x3d0d0338,
           0xbe157b26);

  VSET(16, e64, m1);
  double dscalar_64;
  //                                0.8631130564395617
  BOX_DOUBLE_IN_DOUBLE(dscalar_64, 0x3feb9e9f45c51298);
  //               -0.0203711476424431,  0.4824066080711997, 0.5516514149436702,
  //               -0.0992829085793798,  0.7425996730256406, 0.3080149644930992,
  //               -0.6753031265127754, -0.3309631180416657,
  //               -0.7695072044924456, -0.6726760621514143,
  //               -0.9995830020822822,  0.2485224245452053, 0.7025040357726613,
  //               -0.6452676560401207,  0.5090044889036880,  0.0801949752856408
  VLOAD_64(v2, 0xbf94dc2c93a00800, 0x3fdedfbff74290e0, 0x3fe1a720de3f34c0,
           0xbfb96a9acd667320, 0x3fe7c36063b54b1e, 0x3fd3b68465cb4b28,
           0xbfe59c154d684914, 0xbfd52e7fee0af3fc, 0xbfe89fcd92aa9b24,
           0xbfe5868ff2f7c1a4, 0xbfeffc957df296c0, 0x3fcfcf9532df44b8,
           0x3fe67ae9be5e7376, 0xbfe4a6085afb7c12, 0x3fe049c3c82b791e,
           0x3fb487a86c27c560);
  asm volatile("vfmin.vf v1, v2, %[A]" ::[A] "f"(dscalar_64));
  //              -0.0203711476424431,  0.4824066080711997,  0.5516514149436702,
  //              -0.0992829085793798,  0.7425996730256406,  0.3080149644930992,
  //              -0.6753031265127754, -0.3309631180416657, -0.7695072044924456,
  //              -0.6726760621514143, -0.9995830020822822,  0.2485224245452053,
  //              0.7025040357726613, -0.6452676560401207,  0.5090044889036880,
  //              0.0801949752856408
  VCMP_U64(9, v1, 0xbf94dc2c93a00800, 0x3fdedfbff74290e0, 0x3fe1a720de3f34c0,
           0xbfb96a9acd667320, 0x3fe7c36063b54b1e, 0x3fd3b68465cb4b28,
           0xbfe59c154d684914, 0xbfd52e7fee0af3fc, 0xbfe89fcd92aa9b24,
           0xbfe5868ff2f7c1a4, 0xbfeffc957df296c0, 0x3fcfcf9532df44b8,
           0x3fe67ae9be5e7376, 0xbfe4a6085afb7c12, 0x3fe049c3c82b791e,
           0x3fb487a86c27c560);
};

// Simple random test with similar values (vector-scalar) (masked)
void TEST_CASE4(void) {
  VSET(16, e16, m1);
  double dscalar_16;
  //                              0.4434
  BOX_HALF_IN_DOUBLE(dscalar_16, 0x3718);
  //               -0.2537,  0.5449,  0.2070, -0.5752, -0.3008,  0.0165,
  //               -0.8447,  0.6279,  0.6802,  0.7300,  0.7720, -0.8525, 0.5264,
  //               -0.5249, -0.9839,  0.4875
  VLOAD_16(v2, 0xb40f, 0x385c, 0x32a0, 0xb89a, 0xb4d0, 0x2437, 0xbac2, 0x3906,
           0x3971, 0x39d7, 0x3a2d, 0xbad2, 0x3836, 0xb833, 0xbbdf, 0x37cd);
  VLOAD_8(v0, 0xAA, 0xAA);
  VCLEAR(v1);
  asm volatile("vfmin.vf v1, v2, %[A], v0.t" ::[A] "f"(dscalar_16));
  //                0.0000,  0.4434,  0.0000, -0.5752,  0.0000,  0.0165, 0.0000,
  //                0.4434,  0.0000,  0.4434,  0.0000, -0.8525,  0.0000,
  //                -0.5249,  0.0000,  0.4434
  VCMP_U16(10, v1, 0x0, 0x3718, 0x0, 0xb89a, 0x0, 0x2437, 0x0, 0x3718, 0x0,
           0x3718, 0x0, 0xbad2, 0x0, 0xb833, 0x0, 0x3718);

  VSET(16, e32, m1);
  double dscalar_32;
  //                               0.59499639
  BOX_FLOAT_IN_DOUBLE(dscalar_32, 0x3f1851af);
  //               -0.94244474, -0.52559608, -0.72424960, -0.67824948,
  //               0.22003150, -0.67564118, -0.90376341,  0.16465612,
  //               -0.15494362, -0.01763406,  0.97777683, -0.91671157,
  //               0.81712914, -0.10151604,  0.03442690, -0.14597759
  VLOAD_32(v2, 0xbf71440f, 0xbf068d77, 0xbf39686c, 0xbf2da1c2, 0x3e614ff0,
           0xbf2cf6d2, 0xbf675d0a, 0x3e289b9d, 0xbe1ea98a, 0xbc90754e,
           0x3f7a4f95, 0xbf6aad9c, 0x3f512f60, 0xbdcfe7a4, 0x3d0d0338,
           0xbe157b26);
  VLOAD_8(v0, 0xAA, 0xAA);
  VCLEAR(v1);
  asm volatile("vfmin.vf v1, v2, %[A], v0.t" ::[A] "f"(dscalar_32));
  //                0.00000000, -0.52559608,  0.00000000, -0.67824948,
  //                0.00000000, -0.67564118,  0.00000000,  0.16465612,
  //                0.00000000, -0.01763406,  0.00000000, -0.91671157,
  //                0.00000000, -0.10151604,  0.00000000, -0.14597759
  VCMP_U32(11, v1, 0x0, 0xbf068d77, 0x0, 0xbf2da1c2, 0x0, 0xbf2cf6d2, 0x0,
           0x3e289b9d, 0x0, 0xbc90754e, 0x0, 0xbf6aad9c, 0x0, 0xbdcfe7a4, 0x0,
           0xbe157b26);

  VSET(16, e64, m1);
  double dscalar_64;
  //                                0.8631130564395617
  BOX_DOUBLE_IN_DOUBLE(dscalar_64, 0x3feb9e9f45c51298);
  //                -0.0203711476424431,  0.4824066080711997,
  //                0.5516514149436702, -0.0992829085793798, 0.7425996730256406,
  //                0.3080149644930992, -0.6753031265127754,
  //                -0.3309631180416657, -0.7695072044924456,
  //                -0.6726760621514143, -0.9995830020822822,
  //                0.2485224245452053,  0.7025040357726613,
  //                -0.6452676560401207,  0.5090044889036880, 0.0801949752856408
  VLOAD_64(v2, 0xbf94dc2c93a00800, 0x3fdedfbff74290e0, 0x3fe1a720de3f34c0,
           0xbfb96a9acd667320, 0x3fe7c36063b54b1e, 0x3fd3b68465cb4b28,
           0xbfe59c154d684914, 0xbfd52e7fee0af3fc, 0xbfe89fcd92aa9b24,
           0xbfe5868ff2f7c1a4, 0xbfeffc957df296c0, 0x3fcfcf9532df44b8,
           0x3fe67ae9be5e7376, 0xbfe4a6085afb7c12, 0x3fe049c3c82b791e,
           0x3fb487a86c27c560);
  VLOAD_8(v0, 0xAA, 0xAA);
  VCLEAR(v1);
  asm volatile("vfmin.vf v1, v2, %[A], v0.t" ::[A] "f"(dscalar_64));
  //                0.0000000000000000,  0.4824066080711997, 0.0000000000000000,
  //                -0.0992829085793798,  0.0000000000000000,
  //                0.3080149644930992,  0.0000000000000000,
  //                -0.3309631180416657,  0.0000000000000000,
  //                -0.6726760621514143,  0.0000000000000000,
  //                0.2485224245452053,  0.0000000000000000,
  //                -0.6452676560401207,  0.0000000000000000, 0.0801949752856408
  VCMP_U64(12, v1, 0x0, 0x3fdedfbff74290e0, 0x0, 0xbfb96a9acd667320, 0x0,
           0x3fd3b68465cb4b28, 0x0, 0xbfd52e7fee0af3fc, 0x0, 0xbfe5868ff2f7c1a4,
           0x0, 0x3fcfcf9532df44b8, 0x0, 0xbfe4a6085afb7c12, 0x0,
           0x3fb487a86c27c560);
};

int main(void) {
  enable_vec();
  enable_fp();

  TEST_CASE1();
  TEST_CASE2();
  TEST_CASE3();
  TEST_CASE4();

  EXIT_CHECK();
}
